package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.Binance15minAverageMapper;
import com.ruoyi.binance.domain.Binance15minAverage;
import com.ruoyi.binance.service.IBinance15minAverageService;

/**
 * 实时15分钟均价数据Service业务层处理
 * 
 * @author zq
 * @date 2025-08-07
 */
@Service
public class Binance15minAverageServiceImpl implements IBinance15minAverageService 
{
    @Autowired
    private Binance15minAverageMapper binance15minAverageMapper;

    /**
     * 查询实时15分钟均价数据
     * 
     * @param code 实时15分钟均价数据主键
     * @return 实时15分钟均价数据
     */
    @Override
    public Binance15minAverage selectBinance15minAverageByCode(String code)
    {
        return binance15minAverageMapper.selectBinance15minAverageByCode(code);
    }

    /**
     * 查询实时15分钟均价数据列表
     * 
     * @param binance15minAverage 实时15分钟均价数据
     * @return 实时15分钟均价数据
     */
    @Override
    public List<Binance15minAverage> selectBinance15minAverageList(Binance15minAverage binance15minAverage)
    {
        return binance15minAverageMapper.selectBinance15minAverageList(binance15minAverage);
    }

    /**
     * 新增实时15分钟均价数据
     * 
     * @param binance15minAverage 实时15分钟均价数据
     * @return 结果
     */
    @Override
    public int insertBinance15minAverage(Binance15minAverage binance15minAverage)
    {
        binance15minAverage.setCreateTime(DateUtils.getNowDate());
        return binance15minAverageMapper.insertBinance15minAverage(binance15minAverage);
    }

    /**
     * 修改实时15分钟均价数据
     * 
     * @param binance15minAverage 实时15分钟均价数据
     * @return 结果
     */
    @Override
    public int updateBinance15minAverage(Binance15minAverage binance15minAverage)
    {
        binance15minAverage.setUpdateTime(DateUtils.getNowDate());
        return binance15minAverageMapper.updateBinance15minAverage(binance15minAverage);
    }

    /**
     * 批量删除实时15分钟均价数据
     * 
     * @param codes 需要删除的实时15分钟均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinance15minAverageByCodes(String[] codes)
    {
        return binance15minAverageMapper.deleteBinance15minAverageByCodes(codes);
    }

    /**
     * 删除实时15分钟均价数据信息
     * 
     * @param code 实时15分钟均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinance15minAverageByCode(String code)
    {
        return binance15minAverageMapper.deleteBinance15minAverageByCode(code);
    }
}
